//
//  AppDelegate.m
//  Baby
//
//  Created by YC on 2017/8/8.
//  Copyright © 2017年 YC. All rights reserved.
//

#import "AppDelegate.h"

#import <Bugly/Bugly.h>

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    [self configBugly];
    [self configDDLog];
    [self configCoreData];
    
    return YES;
}


- (void)applicationWillResignActive:(UIApplication *)application {
}


- (void)applicationDidEnterBackground:(UIApplication *)application {
}


- (void)applicationWillEnterForeground:(UIApplication *)application {
}


- (void)applicationDidBecomeActive:(UIApplication *)application {

}


- (void)applicationWillTerminate:(UIApplication *)application {
}

#pragma mark - Config

- (void)configBugly {
    [Bugly startWithAppId:@"900049883"];
}

- (void)configDDLog {
    [DDLog addLogger:[DDASLLogger sharedInstance]];
    [DDLog addLogger:[DDTTYLogger sharedInstance]];
    [[DDTTYLogger sharedInstance] setColorsEnabled:YES];
    [[DDTTYLogger sharedInstance] setForegroundColor:[UIColor blueColor] backgroundColor:nil forFlag:ddLogLevel];
}

- (void)configCoreData {
    [MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreNamed:@"User.sqlite"];
    [MagicalRecord setLoggingLevel:MagicalRecordLoggingLevelVerbose];
}

@end
